package com.zyajac.springBootDemo.entity;


import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

/**
 *  {
 * "status":{"code":0,"message":"操作成功"},
 * "dataTree": [
 *   {"treeId":"001","title": "湖南省","parentId": "0","children":[]},
 *   {"treeId":"002","title": "湖北省","parentId": "0","children":[]},
 *   {"treeId":"003","title": "广东省","parentId": "0","children":[]},
 *   {"treeId":"004","title": "浙江省","parentId": "0","children":[]},
 *   {"treeId":"005","title": "福建省","parentId": "0","children":[]}
 * ]
 * }
 */


@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DTreeNode {
    private String treeId;

    private String title;

    private String parentId;

    private String departId;

    private List<DTreeNode> children;


    @Override
    public String toString() {
        JSONObject resultJSON = new JSONObject( );
        resultJSON.put("treeId", treeId);
        resultJSON.put("title" , title);
        resultJSON.put("parentId",parentId);
        resultJSON.put("children",children.toString());
        return resultJSON.toString();
    }
}
